<template>
	<el-drawer title="供应商详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="供应商等级" prop="levelName">{{form.levelName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="排序号" prop="sortNo">{{form.sortNo}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="企业名称" prop="name">{{form.name}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="企业编号" prop="codeNo">{{form.codeNo}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="企业法人" prop="legalPerson">{{form.legalPerson}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="信用代码" prop="creditCode">{{form.creditCode}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="企业类型" prop="entTypeName">{{form.entTypeName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="企业规模" prop="enterpriseSizeName">{{form.enterpriseSizeName}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="注册资本" prop="registeredCapital">{{form.registeredCapital}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="注册日期" prop="registrationDate">{{form.registrationDate}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="注册地址" prop="registeredAddress">{{form.registeredAddress}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="信用等级" prop="creditRatingName">{{form.creditRatingName}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="经营范围" prop="businessScope">{{form.businessScope}}</el-form-item>
					<el-divider>联系人</el-divider>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="联系人" prop="linkMan">{{form.linkMan}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="系统电话" prop="linkTel">{{form.linkTel}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="电子邮件" prop="email">{{form.email}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="联系地址" prop="address">{{form.address}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="备注说明" prop="remark">{{form.remark}}</el-form-item>
				</el-form>
				<el-divider>供应商证照</el-divider>
				<scTable ref="table" :data="licData" row-key="licId" stripe remoteSort remoteFilter>
					<el-table-column label="#" type="index" width="50"></el-table-column>
					<el-table-column label="证照名称" prop="title" width="100" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column label="证照编号" prop="codeNo" width="100" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column label="证照类型" prop="licTypeName" width="100"></el-table-column>
					<el-table-column label="生效日期" prop="beginTime" width="150"></el-table-column>
					<el-table-column label="终止日期" prop="endTime" width="150"></el-table-column>
					<el-table-column label="附件" prop="attachId" width="300">
						<template #default="scope">
							<attach-menu :attachIds="scope.row.attachId" :roleFlag="3" :preview="true"></attach-menu>
						</template>
					</el-table-column>
				</scTable>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'
export default {
	emits: ['success', 'closed'],
	components: {
		AttachMenu,
	},
	data() {
		return {
			loading: false,
			licData:[],
			form: {
				entId:'',
				name: '',
				sortNo:0,
				codeNo: "",
				creditCode: '',
				legalPerson: '',
				businessScope: '',
				enterpriseSizeName: '',
				registeredCapital:0.0,
				registrationDate:'',
				registeredAddress:'',
				creditRatingName:'',
				address:'',
				linkTel:'',
				linkMan:'',
				email:'',
				entTypeName:'',
				levelName:'',
				status:'0',
				remark:''
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(model){
			this.model=model;
			this.visible = true;
			return this;
		},
		async getInviteEntLicListByEntId(entId){
			let res = await this.$API.invite.inviteEntLic.getInviteEntLicListByEntId.get({entId:entId});
			if(res.code==200)
			{
				this.licData = res.data;
			}
		},
		//表单注入数据
		setData(data){
			this.form.entId = data.entId
			this.form.name = data.name
			this.form.sortNo = data.sortNo
			this.form.codeNo = data.codeNo
			this.form.creditCode = data.creditCode
			this.form.legalPerson = data.legalPerson
			this.form.businessScope = data.businessScope
			this.form.enterpriseSizeName = data.enterpriseSizeName
			this.form.registeredCapital = data.registeredCapital
			this.form.registrationDate = data.registrationDate
			this.form.registeredAddress = data.registeredAddress
			this.form.creditRatingName = data.creditRatingName
			this.form.address = data.address
			this.form.linkTel = data.linkTel
			this.form.linkMan = data.linkMan
			this.form.email = data.email
			this.form.entTypeName = data.entTypeName
			this.form.levelName = data.levelName
			this.form.status = data.status
			this.form.remark = data.remark
			this.getInviteEntLicListByEntId(this.form.entId);
		},
	}
}
</script>

<style>
</style>
